package com.design.pattern.component.generation;

/**
 * 女性身份,女性只有自己会被计入族谱,其子女不会计入族谱
 */
public class Female extends Genealogy {
    public Female(String name, Integer generation, String Identity) {
        super(name,  generation, Identity);
    }
    public Female(String name, Integer generation) {
        super(name,  generation);
    }
    @Override
    public String show() {
        StringBuffer buffer=new StringBuffer();
        for (int i = 1; i < this.getGeneration(); i++) {
            //处理格式
            buffer.append("\t");
        }
        buffer.append("\t").append(this.getIdentity() + ":" + this.getName() + "\r\n");
        return buffer.toString();
    }
}
